$avatarSize: 60px;
$angleSize: 10px;

.container {
    margin: 20px 0;
}

.date {
    text-align: center;
    font-size: 16px;
    color: $font-gray;
}

%content {
    display: flex;
    align-items: flex-start;
}

.content-self {
    @extend %content;
    justify-content: flex-end;
}

.content-other {
    @extend %content;
    justify-content: flex-start;
}

%message {
    position: relative;
    padding: 10px;
    margin: 0;
    border-radius: 10px;
    background-color: #fff;
    color: $font-black;
    line-height: 1.5;
    word-break: break-all;

    &::after {
        position: absolute;
        top: 15px;
        display: block;
        content: '';
        width: $angleSize;
        height: $angleSize;
        border-radius: 2px;
        background-color: #fff;
    }
}

.message-self {
    @extend %message;
    &::after {
        right: 0;
        transform: translate(50%, 0) rotate(45deg);
    }
}

.message-other {
    @extend %message;
    &::after {
        left: 0;
        transform: translate(-50%, 0) rotate(45deg);
    }
}

.avatar {
    order: 1;
    width: $avatarSize;
    height: $avatarSize;
    border-radius: 50%;
    background: #e48e8e center/cover no-repeat;
}

%info {
    max-width: 60%;
    min-width: 100px;
}

.info-self {
    @extend %info;
    order: 0;
    margin-right: 20px;
}

.info-other {
    @extend %info;
    order: 2;
    margin-left: 20px;
}

%name {
    margin: 0 5px 5px;
    font-size: 16px;
    line-height: 22px;
    color: $font-deep-gray;
}

.name-self {
    @extend %name;
    text-align: right;
}

.name-other {
    @extend %name;
    text-align: left;
}
